﻿using NoteHelper.IBusiness;
using NoteHelper.Model;
using System.Collections;
using System.Data;

namespace NoteHelper.Business.IbatisImpl
{
    public class AccountManagerImpl : ManagerBase<Account>, IAccountManager
    {
        public decimal GetCurrentAmount(string accountId)
        {
            string statementName = "QueryLeftAmount";
            LogRuntimeSql(statementName, accountId);
            return Mapper.QueryForObject<decimal>(statementName, accountId);
        }

        public DataTable QueryAccountList(Hashtable ht)
        {
            string statementName = "QueryAccountList";
            LogRuntimeSql(statementName, ht);
            var lst = Mapper.QueryForList<Account>(statementName, ht);
            return lst.ToDataTable("accountlist");
        }
    }
}
